package src.week11.SHIYAN7.Demo2Test;


import junit.framework.TestCase;
import src.week11.SHIYAN7.cn.edu.besti.cs1923.P2315.Sorting1;

public class SortingTest extends TestCase {
    public void testselectionSort() {
        String expect = "[15, 19, 20, 23]";
        String expect2 = "[1, 2, 3, 4, 5]";

        String expect3 = "[2, 3, 15, 1]";
        String expect4 = "[1, 2, 3, 15]";


        //正常
        int test[] = {20,19,23,15,};
        assertEquals(expect, Sorting1.selectionSort(test));
        assertNotEquals(expect2,Sorting1.selectionSort(test));
        //正序
        int test2[] = {1,2,3,4,5};
        assertEquals(expect2,Sorting1.selectionSort(test2));
        assertNotEquals(expect,Sorting1.selectionSort(test2));
        //倒序
        int test3[] = {5,4,3,2,1};
        assertEquals(expect2,Sorting1.selectionSort(test3));
        assertNotEquals(expect,Sorting1.selectionSort(test3));
        //正常
        int test4[] = {2, 3, 1, 15};
        assertEquals(expect4,Sorting1.selectionSort(test4));
        assertNotEquals(expect3,Sorting1.selectionSort(test4));
        //正序
        int test5[] = {1, 2, 3, 15};
        assertEquals(expect4,Sorting1.selectionSort(test5));
        assertNotEquals(expect3,Sorting1.selectionSort(test5));
        //正序
        int test6[] = {15, 3, 2, 1};
        assertEquals(expect4,Sorting1.selectionSort(test6));
        assertNotEquals(expect3,Sorting1.selectionSort(test6));

    }

    private void assertNotEquals(String expect2, String selectionSort) {
    }


}
